home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3c / gettimeofday.z / gettimeofday
Text File  |  1998-10-20  |  6KB  |  133 lines

  1.  
  2.  
  3.  
  4. GGGGEEEETTTTTTTTIIIIMMMMEEEEOOOOFFFFDDDDAAAAYYYY((((3333BBBB))))                                              GGGGEEEETTTTTTTTIIIIMMMMEEEEOOOOFFFFDDDDAAAAYYYY((((3333BBBB))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      gettimeofday, settimeofday - get/set date and time
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttiiiimmmmeeee....hhhh>>>>
  13.  
  14.      _X_P_G_4:
  15.      iiiinnnntttt ggggeeeettttttttiiiimmmmeeeeooooffffddddaaaayyyy((((ssssttttrrrruuuucccctttt ttttiiiimmmmeeeevvvvaaaallll ****ttttpppp,,,, vvvvooooiiiidddd ****ttttzzzzpppp))));;;;
  16.  
  17.      _S_y_s_t_e_m _V:
  18.      iiiinnnntttt ggggeeeettttttttiiiimmmmeeeeooooffffddddaaaayyyy((((ssssttttrrrruuuucccctttt ttttiiiimmmmeeeevvvvaaaallll ****ttttpppp,,,, ............))));;;;
  19.  
  20.      iiiinnnntttt sssseeeettttttttiiiimmmmeeeeooooffffddddaaaayyyy((((ssssttttrrrruuuucccctttt ttttiiiimmmmeeeevvvvaaaallll ****ttttpppp,,,, ............))));;;;
  21.  
  22.      _B_S_D:
  23.      iiiinnnntttt BBBBSSSSDDDDggggeeeettttttttiiiimmmmeeeeooooffffddddaaaayyyy((((ssssttttrrrruuuucccctttt ttttiiiimmmmeeeevvvvaaaallll ****ttttpppp,,,, ssssttttrrrruuuucccctttt ttttiiiimmmmeeeezzzzoooonnnneeee ****ttttzzzzpppp))));;;;
  24.  
  25.      iiiinnnntttt BBBBSSSSDDDDsssseeeettttttttiiiimmmmeeeeooooffffddddaaaayyyy((((ssssttttrrrruuuucccctttt ttttiiiimmmmeeeevvvvaaaallll ****ttttpppp,,,, ssssttttrrrruuuucccctttt ttttiiiimmmmeeeezzzzoooonnnneeee ****ttttzzzzpppp))));;;;
  26.  
  27. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  28.      The system's notion of the current time is obtained with the _g_e_t_t_i_m_e_o_f_d_a_y
  29.      and _B_S_D_g_e_t_t_i_m_e_o_f_d_a_y calls.  The time is expressed in seconds and
  30.      microseconds since midnight (00:00) Coordinated Universal Time (UTC),
  31.      January 1, 1970.  The resolution for (_B_S_D)_g_e_t_t_i_m_e_o_f_d_a_y is never worse
  32.      than 100 HZ (which equals 10 milliseconds).  The actual resolution of
  33.      (_B_S_D)_g_e_t_t_i_m_e_o_f_d_a_y depends on the timer capability of the underlying
  34.      hardware(see _t_i_m_e_r_s(_5)).
  35.  
  36.      The difference between the calls _g_e_t_t_i_m_e_o_f_d_a_y(_s_e_t_t_i_m_e_o_f_d_a_y) and
  37.      _B_S_D_g_e_t_t_i_m_e_o_f_d_a_y(_B_S_D_s_e_t_t_i_m_e_o_f_d_a_y) is the additional second argument _t_z_p in
  38.      the latter.
  39.  
  40.      In IRIX, the time zone used by each process is determined by the TZ
  41.      environment variable.  The _t_z_p argument is present in the BSD calls only
  42.      for compatibility.  It cannot be used to set the time zone for the
  43.      system, and so must be zero for _s_e_t_t_i_m_e_o_f_d_a_y.  If _t_z_p is not zero,
  44.      _B_S_D_g_e_t_t_i_m_e_o_f_d_a_y will return an interpretation of the TIMEZONE environment
  45.      variable.
  46.  
  47.      The structures pointed to by _t_p and _t_z_p are defined in <_s_y_s/_t_i_m_e._h> as:
  48.  
  49.      struct timeval {
  50.           time_t    tv_sec;        /* seconds since Jan. 1, 1970 */
  51.           long tv_usec;       /* and microseconds */
  52.      };
  53.  
  54.      struct timezone {
  55.           int  tz_minuteswest;     /* of Greenwich */
  56.           int  tz_dsttime;    /* type of dst correction to apply */
  57.      };
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GGGGEEEETTTTTTTTIIIIMMMMEEEEOOOOFFFFDDDDAAAAYYYY((((3333BBBB))))                                              GGGGEEEETTTTTTTTIIIIMMMMEEEEOOOOFFFFDDDDAAAAYYYY((((3333BBBB))))
  71.  
  72.  
  73.  
  74.      The _t_i_m_e_z_o_n_e structure indicates the local time zone (measured in minutes
  75.      of time westward from Greenwich), and a flag that, if nonzero, indicates
  76.      that Daylight Saving time applies locally during the appropriate part of
  77.      the year.
  78.  
  79.      Only the super-user may set the time of day or time zone.
  80.  
  81.      These routines emulate the 4.3BSD system calls.
  82.  
  83. RRRREEEETTTTUUUURRRRNNNN
  84.      A 0 return value indicates that the call succeeded.  A -1 return value
  85.      indicates an error occurred, and in this case an error code is stored
  86.      into the global variable _e_r_r_n_o.
  87.  
  88. EEEERRRRRRRROOOORRRRSSSS
  89.      The following error codes may be set in _e_r_r_n_o:
  90.  
  91.      [EFAULT]       An argument address referenced invalid memory.
  92.  
  93.      [EPERM]        A user other than the super-user attempted to set the
  94.                     time.
  95.  
  96.      [EINVAL]       An attempt to change the timezone was made.
  97.  
  98. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  99.      date(1), time(2), stime(2), ctime(3C), see timers(5) for details on the
  100.      resolution.
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.